//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;
using OpenLS.Vml.Serialization;

namespace OpenLS.Vml
{
    public class Path: ShapeElement
    {
        internal const string xmlName = "path";
        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read(xmlName))
            {
                Definition = c.GetOptionalString("v");
                Limo = c.GetOptionalString ("limo");
                TextBoxRect = c.GetOptionalString ("textboxrect");
                bool bbb = false;
                FillOk = c.GetOptionalBoolean ("fillok", bbb);
                StrokeOk = c.GetOptionalBoolean("strokeok", bbb);
                ShadowOk = c.GetOptionalBoolean("shadowok", bbb);
                ArrowOk = c.GetOptionalBoolean("arrowok", bbb);
                GradientShapeOk = c.GetOptionalBoolean("gradientshapeok", bbb);
                TextPathOk = c.GetOptionalBoolean("textpathok", bbb);
                InsetPenOk = c.GetOptionalBoolean("insetpenok", bbb);
                ConnectType = c.GetOptionalEnum<ConnectType>(VmlConstants.OfficeNamespace+ "connecttype");
                ConnectLocs = c.GetOptionalString(VmlConstants.OfficeNamespace+ "connectlocs");
                ConnectAngles = c.GetOptionalString(VmlConstants.OfficeNamespace + "connectangles");
                ExtrusionOk = c.GetOptionalString(VmlConstants.OfficeNamespace + "extrusionok");
            }
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using (WriteContext c = context.Write(xmlName))
            {
                c.SetOptionalString("v", Definition);
                c.SetOptionalString("limo", Limo);
                c.SetOptionalString("textboxrect", TextBoxRect);
                bool bbb = false;
                c.SetOptionalBoolean("fillok", FillOk, bbb);
                c.SetOptionalBoolean("strokeok", StrokeOk, bbb);
                c.SetOptionalBoolean("shadowok", ShadowOk, bbb);
                c.SetOptionalBoolean("arrowok", ArrowOk, bbb);
                c.SetOptionalBoolean("gradientshapeok", GradientShapeOk, bbb);
                c.SetOptionalBoolean("textpathok", TextPathOk, bbb);
                c.SetOptionalBoolean("insetpenok", InsetPenOk, bbb);
                c.SetOptionalEnum(VmlConstants.OfficeNamespace + "connecttype", ConnectType);
                c.SetOptionalString(VmlConstants.OfficeNamespace + "connectlocs", ConnectLocs);
                c.SetOptionalString(VmlConstants.OfficeNamespace + "connectangles", ConnectAngles);
                c.SetOptionalString(VmlConstants.OfficeNamespace + "extrusionok", ExtrusionOk);
            }
        }

        private string _v;

        public string Definition
        {
            get { return _v; }
            set { _v = value; }
        }
        private string _limo;

        public string Limo
        {
            get { return _limo; }
            set { _limo = value; }
        }
        private string _textboxrect;

        public string TextBoxRect
        {
            get { return _textboxrect; }
            set { _textboxrect = value; }
        }
        private bool _fillok;

        public bool FillOk
        {
            get { return _fillok; }
            set { _fillok = value; }
        }
        private bool _strokeok;

        public bool StrokeOk
        {
            get { return _strokeok; }
            set { _strokeok = value; }
        }
        private bool _shadowok;

        public bool ShadowOk
        {
            get { return _shadowok; }
            set { _shadowok = value; }
        }
        private bool _arrowok;

        public bool ArrowOk
        {
            get { return _arrowok; }
            set { _arrowok = value; }
        }
        private bool _gradientshapeok;

        public bool GradientShapeOk
        {
            get { return _gradientshapeok; }
            set { _gradientshapeok = value; }
        }
        private bool _textpathok;

        public bool TextPathOk
        {
            get { return _textpathok; }
            set { _textpathok = value; }
        }
        private bool _insetpenok;

        public bool InsetPenOk
        {
            get { return _insetpenok; }
            set { _insetpenok = value; }
        }
        private ConnectType? _connecttype;

        public ConnectType? ConnectType
        {
            get { return _connecttype; }
            set { _connecttype = value; }
        }
        private string _connectlocs;

        public string ConnectLocs
        {
            get { return _connectlocs; }
            set { _connectlocs = value; }
        }
        private string _connectangles;

        public string ConnectAngles
        {
            get { return _connectangles; }
            set { _connectangles = value; }
        }
        private string _extrusionok;

        public string ExtrusionOk
        {
            get { return _extrusionok; }
            set { _extrusionok = value; }
        }
	
	
	
	
	
	
	
	
	
	
	
	
	
    }
}
